import { HttpClient } from "@angular/common/http";
import { Injectable, ɵConsole } from "@angular/core";
import { Location } from "@angular/common";
import { catchError } from "rxjs/operators";
import { Observable } from "rxjs";
import { NzModalService, NzMessageService } from "ng-zorro-antd";
import { Subject } from "rxjs";
import { MapConfig,TerrainProvider } from "../model/map.model";
import { cesiumCamera } from "./com";
import { scene,orientation } from "../model/camera.model";
declare var Cesium;
@Injectable()
export class CesiumMap {
  public cesium
  protected mapConfig: MapConfig;
  public cesiumCamera: cesiumCamera;
  public constructor() {
    this.cesiumCamera=new cesiumCamera()
  }

  public CesiumTerrainProvider(par: TerrainProvider) {
    const terrainProvider=new Cesium.CesiumTerrainProvider(par)
    return terrainProvider
  }

  public createWorldTerrain(par: TerrainProvider) {
    const terrainProvider=new Cesium.createWorldTerrain(par)
    return terrainProvider
  }
  /**
   * 初始化设置视野居中位置
   * @param Viewer 
   * @param destination 
   * @param orientation (long，精度，lat维度，distance，距离)
   */
  public setView(Viewer:any,destination:any,orientation:orientation){
    this.cesiumCamera.setView(Viewer,orientation,orientation)
  }
 
}
